package cn.pzhu.java.ch04.collectiondemo;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class CollectionDemo01 {

	public static void main(String[] args) {
		Collection<String> c=new ArrayList<String>();
		c.add("JAVA");
		c.add("C#");
		c.add("C++");
		
		for(String s:c){
			System.out.println(s);
		}
		
		Iterator<String> it=c.iterator();
		while(it.hasNext()){
			String s=it.next();
			System.out.println(s);
		}
		
	}

}
